///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep  8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#include "preferencesdialog.h"

#include "../ico/play.xpm"

///////////////////////////////////////////////////////////////////////////

PreferencesDialog::PreferencesDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* mainSizer;
	mainSizer = new wxBoxSizer( wxVERTICAL );
	
	wxFlexGridSizer* fgSizer1;
	fgSizer1 = new wxFlexGridSizer( 2, 2, 0, 0 );
	fgSizer1->SetFlexibleDirection( wxBOTH );
	fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_staticText1 = new wxStaticText( this, wxID_ANY, _("Words to learn:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText1->Wrap( -1 );
	fgSizer1->Add( m_staticText1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_textCtrlWords = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer1->Add( m_textCtrlWords, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
	
	m_staticText2 = new wxStaticText( this, wxID_ANY, _("Score increment:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText2->Wrap( -1 );
	fgSizer1->Add( m_staticText2, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_textCtrlIncrement = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer1->Add( m_textCtrlIncrement, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
	
	m_staticTextTime = new wxStaticText( this, wxID_ANY, _("Break time (min):"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticTextTime->Wrap( -1 );
	fgSizer1->Add( m_staticTextTime, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_textCtrlTime = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer1->Add( m_textCtrlTime, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
	
	m_staticText4 = new wxStaticText( this, wxID_ANY, _("Sound for correct answer:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText4->Wrap( -1 );
	fgSizer1->Add( m_staticText4, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	wxBoxSizer* bSizer3;
	bSizer3 = new wxBoxSizer( wxHORIZONTAL );
	
	m_buttonCorrect = new wxButton( this, wxID_ANY, _("Correct"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer3->Add( m_buttonCorrect, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_bpButtonCorrect = new wxBitmapButton( this, wxID_ANY, wxBitmap( play_xpm ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
	bSizer3->Add( m_bpButtonCorrect, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	fgSizer1->Add( bSizer3, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_staticText41 = new wxStaticText( this, wxID_ANY, _("Sound for incorrect answer:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText41->Wrap( -1 );
	fgSizer1->Add( m_staticText41, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	wxBoxSizer* bSizer31;
	bSizer31 = new wxBoxSizer( wxHORIZONTAL );
	
	m_buttonCorrect1 = new wxButton( this, wxID_ANY, _("Incorrect"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer31->Add( m_buttonCorrect1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_bpButtonIncorrect = new wxBitmapButton( this, wxID_ANY, wxBitmap( play_xpm ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
	bSizer31->Add( m_bpButtonIncorrect, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	fgSizer1->Add( bSizer31, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
	
	mainSizer->Add( fgSizer1, 1, wxEXPAND, 5 );
	
	m_checkBox1 = new wxCheckBox( this, wxID_ANY, _("Learn only one card before break time"), wxDefaultPosition, wxDefaultSize, 0 );
	mainSizer->Add( m_checkBox1, 0, wxALL|wxEXPAND, 5 );
	
	m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
	mainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
	
	wxBoxSizer* buttonSizer;
	buttonSizer = new wxBoxSizer( wxHORIZONTAL );
	
	m_buttonOk = new wxButton( this, wxID_OK, _("&Ok"), wxDefaultPosition, wxDefaultSize, 0 );
	m_buttonOk->SetDefault(); 
	buttonSizer->Add( m_buttonOk, 0, wxALL, 5 );
	
	m_buttonCancel = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
	buttonSizer->Add( m_buttonCancel, 0, wxALL, 5 );
	
	mainSizer->Add( buttonSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
	
	this->SetSizer( mainSizer );
	this->Layout();
	mainSizer->Fit( this );
	
	this->Centre( wxBOTH );
	
	// Connect Events
	this->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ) );
	m_textCtrlWords->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ), NULL, this );
	m_textCtrlIncrement->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ), NULL, this );
	m_textCtrlTime->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ), NULL, this );
	m_buttonCorrect->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PreferencesDialog::OnCorrectClick ), NULL, this );
	m_buttonCorrect->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ), NULL, this );
	m_bpButtonCorrect->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PreferencesDialog::OnPlayCorrect ), NULL, this );
	m_bpButtonCorrect->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ), NULL, this );
	m_buttonCorrect1->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PreferencesDialog::OnIncorrectClick ), NULL, this );
	m_buttonCorrect1->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ), NULL, this );
	m_bpButtonIncorrect->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PreferencesDialog::OnPlayIncorrect ), NULL, this );
	m_bpButtonIncorrect->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ), NULL, this );
	m_buttonOk->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PreferencesDialog::OnOkClick ), NULL, this );
	m_buttonOk->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ), NULL, this );
	m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PreferencesDialog::OnCancelClick ), NULL, this );
	m_buttonCancel->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ), NULL, this );
}

PreferencesDialog::~PreferencesDialog()
{
	// Disconnect Events
	this->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ) );
	m_textCtrlWords->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ), NULL, this );
	m_textCtrlIncrement->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ), NULL, this );
	m_textCtrlTime->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ), NULL, this );
	m_buttonCorrect->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PreferencesDialog::OnCorrectClick ), NULL, this );
	m_buttonCorrect->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ), NULL, this );
	m_bpButtonCorrect->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PreferencesDialog::OnPlayCorrect ), NULL, this );
	m_bpButtonCorrect->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ), NULL, this );
	m_buttonCorrect1->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PreferencesDialog::OnIncorrectClick ), NULL, this );
	m_buttonCorrect1->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ), NULL, this );
	m_bpButtonIncorrect->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PreferencesDialog::OnPlayIncorrect ), NULL, this );
	m_bpButtonIncorrect->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ), NULL, this );
	m_buttonOk->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PreferencesDialog::OnOkClick ), NULL, this );
	m_buttonOk->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ), NULL, this );
	m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PreferencesDialog::OnCancelClick ), NULL, this );
	m_buttonCancel->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( PreferencesDialog::OnKeyDown ), NULL, this );
	
}
